package com.woniushop.entity;

import java.math.BigDecimal;

/**
 * 商品实体类
 * 
 * @author 崔新雄
 *
 */
public class Goods {

	private Integer gid;// 商品id
	private Integer uid;// 用户id;创建该商品的管理员用户id
	private Integer gtid;// 商品类别id
	private String gname;// 商品名称
	private String gdesc;// 商品描述
	private BigDecimal gprice;// 商品价格
	private String gpic;// 商品图片
	private Integer gstock;// 商品库存
	private Integer gstate;// 商品状态;1：上架；2：下架

	private String gtname;// 该商品所属的商品类别名
	private String uaccount;// 用户账号;创建该商品的管理员用户账号
	private String uname;// 用户昵称;创建该商品的管理员用户昵称

	public Integer getGid() {
		return gid;
	}

	public void setGid(Integer gid) {
		this.gid = gid;
	}

	public Integer getUid() {
		return uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	public Integer getGtid() {
		return gtid;
	}

	public void setGtid(Integer gtid) {
		this.gtid = gtid;
	}

	public String getGname() {
		return gname;
	}

	public void setGname(String gname) {
		this.gname = gname;
	}

	public String getGdesc() {
		return gdesc;
	}

	public void setGdesc(String gdesc) {
		this.gdesc = gdesc;
	}

	public BigDecimal getGprice() {
		return gprice;
	}

	public void setGprice(BigDecimal gprice) {
		this.gprice = gprice;
	}

	public String getGpic() {
		return gpic;
	}

	public void setGpic(String gpic) {
		this.gpic = gpic;
	}

	public Integer getGstock() {
		return gstock;
	}

	public void setGstock(Integer gstock) {
		this.gstock = gstock;
	}

	public Integer getGstate() {
		return gstate;
	}

	public void setGstate(Integer gstate) {
		this.gstate = gstate;
	}

	public String getGtname() {
		return gtname;
	}

	public void setGtname(String gtname) {
		this.gtname = gtname;
	}

	public String getUaccount() {
		return uaccount;
	}

	public void setUaccount(String uaccount) {
		this.uaccount = uaccount;
	}

	public String getUname() {
		return uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	@Override
	public String toString() {
		return "Goods [gid=" + gid + ", uid=" + uid + ", gtid=" + gtid + ", gname=" + gname + ", gdesc=" + gdesc
				+ ", gprice=" + gprice + ", gpic=" + gpic + ", gstock=" + gstock + ", gstate=" + gstate + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((gid == null) ? 0 : gid.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Goods other = (Goods) obj;
		if (gid == null) {
			if (other.gid != null)
				return false;
		} else if (!gid.equals(other.gid))
			return false;
		return true;
	}

}
